<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>投诉</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/page.css">
    <script src="../js/jquery-3.2.1.min.js"></script>
    <script src="../js/media.js"></script>
    <script src="../js/common.js"></script>
    <style>
        .btn-foot{
            line-height: 40px;
            background: #fa4535;
            color: #fff;
            text-align: center;
            border-radius: 4px;
            position: fixed;
            left: 10%;
            right: 10%;
            bottom: 20px;
        }
    </style>
</head>

<body>
    <!--头部-->
 <!--   <div class="public-header flex">
        &lt;!&ndash;<span class="public-header-left-search"></span>&ndash;&gt;
        <span class="public-header-left-back"></span>
        <span class="public-header-center">投诉</span>
        <span class="public-header-right"></span>
    </div>-->

    <!--正文-->
    
    <div class="Complaints bc-gray">
        <p class="t1">请选择投诉原因</p>
        <ul>
            <li class="flex">
                <span class="li-left">分类错误</span>
                <img src="../img/全选%2002@2x.png" alt="" style="width: 20px;" data-id="分类错误" class="img-list">
            </li>
            <li class="flex">
                <span class="li-left">违禁品</span>
                <img src="../img/全选%2002@2x.png" alt="" style="width: 20px;" data-id="违禁品"class="img-list">
            </li>
            <li class="flex">
                <span class="li-left">商品信息有误</span>
                <img src="../img/全选%2002@2x.png" alt="" style="width: 20px;" data-id="商品信息有误"class="img-list">
            </li>
            <li class="flex">
                <span class="li-left">假货</span>
                <img src="../img/全选%2002@2x.png" alt="" style="width: 20px;" data-id="假货" class="img-list">
            </li>
            <li class="flex">
                <span class="li-left">投诉商家</span>
                <img src="../img/全选%2002@2x.png" alt="" style="width: 20px;" data-id="投诉商家" class="img-list">
            </li>
        </ul>
        <!--<p class="t2">投诉记录</p>-->
    </div>
    <div class="btn-foot" id="tjpost">
        下一步
    </div>
    <!--灰色浮层-->
    <div class="mask" style="background: rgba(50,50,50,0.5);display:none;z-index:2;"></div>

    <!--弹出框-->
    <div class="Complaints-box" style="display: none;">
        <h5>提示</h5>
        <p>确认投诉此商品？</p>
        <div class="flex button">
            <div class="left">取消</div>
            <div class="right">确定</div>
        </div>
    </div>
</body>
<script>
    var _dataId = '';
    var flagSelect = false;
    $(function (){
        $(".img-list").click(function (){
            $(".img-list").attr("src","../img/全选%2002@2x.png");
            $(this).attr("src","../img/全选%2001@2x.png");
            _dataId = encodeURI(encodeURI($(this).attr("data-id")));
            flagSelect = true;
        })
        $("#tjpost").click(function (){
/*            if(_dataId == ''){
                alert("请选择投诉原因");
                return false;
            }
            console.log(_dataId);
            var urls = "?produceId="+getQueryString("pid")+"&uid="+sessionStorage.getItem("uid")+"&reason="+_dataId;
            $.ajax({
                url:base_url+"ZITAOHUI/addComplaint"+urls,
                dataType:"json",
                success:function (data){
                    console.log(data);
                    if(data.code == 1){
                        alert("提交成功");
                    }
                }
            })*/
           if(flagSelect){
           		if(decodeURI(decodeURI(_dataId))=='投诉商家'){//这个是投诉商家
           			window.location.href = "Complaints-type.html?produceId="+getQueryString("pid")+"&uid="+sessionStorage.getItem("uid")+"&reason="+_dataId+"&storeid="+getQueryString('storeid')+"&comflag=3"
           		}else{
    					window.location.href = "Complaints-type.html?produceId="+getQueryString("pid")+"&uid="+sessionStorage.getItem("uid")+"&reason="+_dataId+"&storeid=''"+"&comflag=1";//投诉产品          			
           		};
           }else{
           		alert('请选择投诉分类')
           };
        })
    })
</script>
</html>